package factoryfunction.service;

import factoryfunction.service.factory.AwardFactory;
import factoryfunction.service.factory.impl.AiQiYiFactory;
import factoryfunction.service.factory.impl.DiscountFactory;
import factoryfunction.service.factory.impl.SmallGiftFactory;

import java.util.HashMap;

/**
 * @Author liangbaigao
 * @Date 2023/9/25 23:49
 */
public class AwardFactoryFactory {


    public static final HashMap<String, AwardFactory> FACTORY_MAP = new HashMap<>();

    static {
        FACTORY_MAP.put("1",new DiscountFactory());
        FACTORY_MAP.put("2",new AiQiYiFactory());
        FACTORY_MAP.put("3",new SmallGiftFactory());
    }

    public static AwardFactory getFactory(String type){
        return FACTORY_MAP.get(type);
    }

}
